<?php
namespace app\api\controller;
use app\model\Partners as PartnersModel;
use app\model\Token as TokenModel;
use think\Db;


class Partners extends Base
{   
    /**
     * @Author   CCH
     * @DateTime 2020-05-23T12:10:10+0800
     * @return   数据列表
     */
    public function index(){
        $map_params = [
            
        ];
        $map = getSearchParam($map_params);

        $model = new PartnersModel();

        $page_param = ['page'=>input('page_index',1),'list_rows'=>input('page_size',10)];
        $list = $model->where($map)->order('sort desc,id desc')->paginate($page_param)->toarray();
        foreach ($list['data'] as $k => $vo) {
            
        }
        return apiResult('2000','获取成功',$list);
    }

    /**
     * 获取详情
     * @Author   cch
     * @DateTime 2020-05-26T17:22:45+0800
     * @return   [type]                   [description]
     */
    public function read($id){
        $model = new PartnersModel();
        $data = $model->where('id',$id)->find();
        return apiResult('2000','获取成功',$data);
    }

   


}
